package km.TestAnimationGif;

import android.app.Activity;
import android.os.Bundle;
import android.view.*;
import android.view.View.*;
import android.view.animation.*;
import android.widget.*;

public class TestAnimationGif extends Activity {
    private  Button btn = null;
	private AniView vImg;
	 Animation refreshani = null;
	private LinearLayout vImgLayout;
	private Button btn2;       
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        vImg=(AniView)findViewById(R.id.vImg);
        vImgLayout=(LinearLayout)findViewById(R.id.vImg_layout);
//        setBtnAni();
        btn =(Button)findViewById(R.id.btn);
        btn.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
					vImg.setVisibility(View.VISIBLE);
			}
		});
        btn2 =(Button)findViewById(R.id.btn2);
        btn2.setOnClickListener(new OnClickListener() {
        	
        	public void onClick(View v) {
        			vImg.setVisibility(View.GONE);
        	}
        });
//        LayoutAnimationController layoutAni;
//        layoutAni = AnimationUtils.loadLayoutAnimation(this, R.anim.popinlayout);
//        vImg =(ViewGroup)findViewById(R.id.vImg);
//        this.setLayoutAnimation(layoutAni);

    }
	public void setBtnAni() {
		refreshani = new RotateAnimation(0f, -360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
		refreshani.setInterpolator(new LinearInterpolator());
		refreshani.setDuration(1000);
		refreshani.setRepeatCount(1);
	} 
}